<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;

/**
 * @property array $params 产品参数
 * @property float $freight 运费
 * @property int $id
 * @property int $num 库存
 * @property int $score 积分
 * @property int $sell_num 卖出数量
 * @property string $buy_note 购买须知
 * @property string $content 商品详情
 * @property string $createtime
 * @property string $images 商品图片
 * @property string $name 商品名称
 * @property string $sku_ids 规格
 * @property string $source_address 发货地
 * @property string $videos 商品视频
 * @property-read \app\model\ScoreGoodsOrdersAssess[] $assess
 * @mixin \think\Model
 */
class ScoreGoods extends Model
{
    protected $createTime = 'createtime';

    protected $type=[
        'params'=>'json',
    ];

    /**
     * 评价
     * @return \think\model\relation\HasMany
     */
    function assess()
    {
        return $this->hasMany(ScoreGoodsOrdersAssess::class,'goods_id');
    }
	
	function sku()
	{
		return $this->belongsTo(ScoreGoodsSku::class,'sku_id');
	}



}
